package com.ct.dao.searching.hibernate;

import java.util.List;
import java.util.Collection;
import java.util.Iterator;
import java.util.ListIterator;
import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: nmkravchenko
 * Date: 22.10.2009
 * Time: 18:17:00
 * To change this template use File | Settings | File Templates.
 */
public class ListWithCount<E> implements List<E>, Serializable {

	private List<E> originalCollection;
	private int overallCount;

	public ListWithCount( List<E> anOriginalCollection, int anOverallCount) {
		originalCollection = anOriginalCollection;
		overallCount = anOverallCount;
	}

	public int getOverallCount() { return overallCount; }

	public boolean add(E anObject) {
		return originalCollection.add(anObject);
	}

	public boolean addAll(Collection<? extends E> aCollection) {
		return originalCollection.addAll(aCollection);
	}

	public void clear() {
		originalCollection.clear();
	}

	public boolean contains(Object anObject) {
		return originalCollection.contains(anObject);
	}

	public boolean containsAll(Collection<?> aCollection) {
		return originalCollection.containsAll(aCollection);
	}

	public boolean isEmpty() {
		return originalCollection.isEmpty();
	}

	public Iterator<E> iterator() {
		return originalCollection.iterator();
	}

	public boolean remove(Object anObject) {
		return originalCollection.remove(anObject);
	}

	public boolean removeAll(Collection<?> aCollection) {
		return originalCollection.removeAll(aCollection);
	}

	public boolean retainAll(Collection<?> aCollection) {
		return originalCollection.retainAll(aCollection);
	}

	public int size() {
		return originalCollection.size();
	}

	public Object[] toArray() {
		return originalCollection.toArray();
	}

	public <T>T[]  toArray(T[] anArray) {
		return originalCollection.toArray(anArray);
	}

	public void add(int anIndex, E anElement) {
		originalCollection.add(anIndex, anElement);
	}

	public boolean addAll(int anIndex, Collection<? extends E> aCollection) {
		return originalCollection.addAll(anIndex, aCollection);
	}

	public E get(int anIndex) {
		return originalCollection.get(anIndex);
	}

	public int indexOf(Object anObject) {
		return originalCollection.indexOf(anObject);
	}

	public int lastIndexOf(Object anObject) {
		return originalCollection.lastIndexOf(anObject);
	}

	public ListIterator<E> listIterator() {
		return originalCollection.listIterator();
	}

	public ListIterator<E> listIterator(int anIndex) {
		return originalCollection.listIterator(anIndex);
	}

	public E remove(int anIndex) {
		return originalCollection.remove(anIndex);
	}

	public E set(int anIndex, E anElement) {
		return originalCollection.set(anIndex, anElement);
	}

	public List<E> subList(int aFromIndex, int aToIndex) {
		return originalCollection.subList(aFromIndex, aToIndex);
	}
}
